const enterpriseVue = new Vue({
    el: '#app',
    data() {
        return {
            rules: {

            },
            form: [{
                Other_Service_Detail_SerialNumber: '',
                Other_Service_Detail_Name: '',
                Other_Service_Detail_Address: '',
                Other_Service_Detail_URL: '',
                Other_Service_Detail_Phone: '',
                Other_Service: '', Other_Service_Type: "2"
            }],
        }
    },
    mounted() {
    },
    methods: {
        add_form() {
            this.form.push({
                Other_Service_Detail_SerialNumber: '',
                Other_Service_Detail_Name: '',
                Other_Service_Detail_Address: '',
                Other_Service_Detail_URL: '',
                Other_Service_Detail_Phone: '',
                Other_Service: '', Other_Service_Type: "2"
            })
        },
        remove_form() {

        },
        submitForm() {
            const _this = this;
            $.ajax({
                url: DomainName + '/getAddAction?token=' + $.cookie("token"),
                type: 'POST',
                data: {
                    Data: JSON.stringify({ other_service_detail: this.form }),
                },
                success: function (res) {
                    _this.$message({
                        message: '添加成功',
                        type: 'success'
                    });
                },
                error: function () {
                    _this.$message.error("操作失败，请稍后再试")
                },
                complete: function (XMLHttpRequest) {
                    if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
                        window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
                    }
                }
            })
        },
    }
})